package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class MaterialAdapter extends StkProviderMultiAdapter<Integer> {

    public MaterialAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(35));
        addItemProvider(new MaterialProvider());
    }

    private class MaterialProvider extends BaseItemProvider<Integer> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_material;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, Integer bean) {
            baseViewHolder.setImageResource(R.id.ivMaterialItemImg, bean);
        }
    }
}
